<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style>
			#div{
				position: relative;
				/* relative 相对定位 相对自己
				 absulate 绝对定位 相对自己的爸爸
				 fix 固定定位 
				 */
			}
			
		</style>
	</head>
	<body>
		<div id="div">此广告位招租
		<button  id = 'closeBtn' "float: right">关闭</button>
		</div>
		<script>
			
			var btn = document.getElementById('closeBtn')
			btn.addEventListener('click',function(){
				var adv = document.getElementById('div')
				adv.style.display='none';
			})
		</script>
	</body>
</html>